{% extends './index.html' %}

{% block title %}我的订单{% endblock %}

{% block subject %}

<header>
	<!--首页导航-->
	<ul class="layui-nav" style="display:flex;justify-content:center;">
		<li class="layui-nav-item"><a href="/washer/index" style="font-size:24px;">首页</a></li>
		<li class="layui-nav-item"><a href="/washapp/index" style="font-size:24px;">洗衣</a></li>
		<li class="layui-nav-item"><a href="/community/index" style="font-size:24px;">社区</a></li>
		<li class="layui-nav-item layui-this"><a href="/washer/login" style="font-size:24px;">我的</a></li>
	</ul>
</header>

<main>
	<!--当前订单-->
	<div class="current" style="width:60%;margin:20px auto;box-shadow:0px 0px 3px #000000;">
		<table class="layui-table" lay-even>
			<caption style="font-size:26px;color:#1E90FF;margin:0 auto;background-color:#e3e5e8;">当前订单</caption>
			<tr>
				<th>序号</th>
				<th>订单号</th>
				<th>用户</th>
				<th>设备号</th>
				<th>创建时间</th>
				<th>操作</th>
			</tr>
			{% for c_order in current_order.values %}
			<tr>
				<td>{{ forloop.counter }}</td>
				<td>{{ c_order.id }}</td>
				<td>{{ c_order.user_id }}</td>
				<td>{{ c_order.washer_id }}</td>
				<td>{{ c_order.timer }}</td>
				<td>
					<a style="font-size:18px;color:#DC143C;"
						href="/washapp/startwash/{{c_order.washer_id}}/{{c_order.user_id}}">结束</a>
				</td>
			</tr>
			{% empty %}
			<tr>
				<td>查</td>
				<td>询</td>
				<td>不</td>
				<td>到</td>
				<td>订</td>
				<td>单</td>
			</tr>
			{% endfor %}
		</table>
	</div>
	<!--历史订单-->
	<div class="history" style="width:60%;margin:20px auto;box-shadow:0px 0px 3px #000000;">
		<table class="layui-table" lay-even>
			<caption style="font-size:26px;color:#8B4513;margin:0 auto;background-color:#e3e5e8;">历史订单</caption>
			<tr>
				<th>序号</th>
				<th>订单号</th>
				<th>用户</th>
				<th>设备号</th>
				<th>创建时间</th>
				<th>操作</th>
			</tr>
			{% for u_order in history_order %}
			<tr>
				<td>{{ forloop.counter }}</td>
				<td>{{ u_order.id }}</td>
				<td>{{ u_order.user_id }}</td>
				<td>{{ u_order.washer_id }}</td>
				<td>{{ u_order.timer }}</td>
				<td>
					<a style="font-size:18px;color:#DC143C;" href="/washer/delorder/{{u_order.id}}"
						onclick="return confirm('\n此操作不可逆！\n\r且可能导致异常！\n\r确认删除该订单？')">删除</a>
				</td>
			</tr>
			{% empty %}
			<tr>
				<td>查</td>
				<td>询</td>
				<td>不</td>
				<td>到</td>
				<td>订</td>
				<td>单</td>
			</tr>
			{% endfor %}
		</table>
	</div>

</main>

<footer>

</footer>

{% endblock %}
